package com.cssw.fyzb.core.dao.tesk;


import com.cssw.fyzb.core.model.dodb.RuleInst;
import com.ydn.dbframe.plugin.activerecord.Page;

import java.util.List;

public interface RuleInstDao {

    RuleInst getById(Long instId);

    //根据userId 和任务id 查找
    Integer getRuleInst(Long userId, Long taskId);

    //查看用户今天是否有任务
    RuleInst getDayTask(Long userId);

    //新增
    Long save(RuleInst ruleInst);

    void update(RuleInst ruleInst);

    //我的任务（废弃）
    List<RuleInst> listRuleInst(Long userId, String status);

    List<RuleInst> listValidRuleInst(Long userId);

    //我的今日任务
    Page<RuleInst> listDayRuleInst(Long userId, String status, int pageNumber, int pageSize);

    Page<RuleInst>  myTaskList(Long userId, String status, int pageNumber, int pageSize);
    //用户今日任务总完成时长
    RuleInst getUserTotalTiem(Long userId);

    //所有用户今日任务完成时长
    List<RuleInst> getTotalTime();

    Long updateRuleInstDao(RuleInst ruleInst);

    //我的领取数
    Integer myClaim(Long userId,Long taskId);
}
